package com.congee02.utils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author congee(congee02 @ 163.com)
 * @date 1/27/2023 10:58 AM
 */
public class ReflectUtils {

    private ReflectUtils() {
    }

    public static List<Class> getAllSuperClasses(Class clazz) {
        ArrayList<Class> superClassList = new ArrayList<>();
        Class superClass = clazz.getSuperclass();
        while (superClass != null) {
            if (superClass.getName().equals("java.lang.Object")) break;
            superClassList.add(superClass);
            superClass = superClass.getSuperclass();
        }
        return superClassList;
    }

}
